import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.URL;

import javax.swing.*;

public class Window extends JFrame{

	private static final long serialVersionUID = 1L;
	
	JTextArea textArea_in;
	JScrollPane sc1;
	JScrollPane sc2;
	JButton button_go;
	JBrowser browser;
	JLabel trustedIcon;
	JLabel premIcon;
	
	public Window(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("ESL Check");
		setSize(220, 300);
		setLayout(null);
		setResizable(false);
		textArea_in = new JTextArea();
		textArea_in.setBounds(10, 10, 260, 100);
		textArea_in.setText("0:0:12894714");
		sc1 = new JScrollPane(textArea_in);
		sc1.setBounds(10, 10, 200, 100);
		add(sc1);
		trustedIcon = new JLabel(new ImageIcon("T3.gif"));
		trustedIcon.setBounds(185, 160, 80, 80);
		trustedIcon.setVisible(true);
        add(trustedIcon);
        premIcon = new JLabel(new ImageIcon("prem.gif"));
        premIcon.setBounds(185, 180, 80, 80);
        premIcon.setVisible(true);
        add(premIcon);
		browser = new JBrowser();
		browser.setEditable(false);
		browser.setEditorKit(new javax.swing.text.html.HTMLEditorKit());
		sc2 = new JScrollPane(browser);
		sc2.setBounds(10, 160, 200, 100);
		add(sc2);
		button_go = new JButton("GO!");
		button_go.setBounds(10, 120, 200, 30);
		button_go.addActionListener(new ActionListener(){
			@Override
			public void actionPerformed(ActionEvent arg0) {
				browser.setText(ESLCheck.check(textArea_in.getText()));
				premIcon.setVisible(true);
				trustedIcon.setVisible(true);
				//browser.setText(textArea_in.getText());
			}
		});
		add(button_go);
	}

}
